//controlls
define(function (require, exports, module) {
    const Vue=require("vue");
    var template=require('text!./index.html');
    module.exports=Vue.extend({
        template:template,
        data:function () {
            return {

            }
        },
        created:function () {
            this.$store.dispatch('UserInfo',this.user_info);
        },
        computed:{
            oauth:function () {
                return this.$store.getters.getOAuth;
            },
            isBack:function () {
                return this.$store.getters.getIsBack;
            },
            user_info:function () {
                return this.$store.getters.getUserInfo;
            },
            user_certification_text:function () {
                var status=this.user_info.user_certification;
                return status===1?"已认证":"未认证";
            },
            user_photo:function () {
                var photo=this.user_info.user_photos;
                if(!photo){
                    if(this.oauth.open_id){
                        return this.oauth.wei_xin_user.headimgurl;
                    }
                    return 'images/person.png';
                }else{
                    return "http://app.us-ebike.com:8080/"+photo;
                }
            }
        },
        beforeRouteEnter:function (to,from,next) {
            next(function (vm) {
                if(!vm.isBack){
                    //vm.$store.dispatch('UserInfo',vm.user_info);
                }
            })
        },
    });
});